<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Login</title>
    
	<!-- jquery -->
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    
    <!-- Bootstrap Core CSS -->
    <link href="./Public/Admin/css/bootstrap.min.css" rel="stylesheet" />

    <!-- Custom CSS -->
    <link href="./Public/Admin/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
	<link rel="stylesheet" href="./Public/Admin/css/font-awesome.min.css" />

	<!-- css -->
	<link rel="stylesheet" href="./Public/Admin/css/css.css" />
	
	<style>
	.user_login_msg{
		width: 100px;
		height: 50px;
		text-align: center;
		font-size: 14px;
		line-height: 50px;
		color:#fff;
		background: rgb(86, 78, 78);
		position: fixed;
		left: 47.5%;
		top:30%;
		display:none;
	}
	</style>
</head>

<body>

    <div class="container" style="margin-top:100px;">
        <div class="row">
            <div class="col-md-4 col-md-offset-4">
                <div class="login-panel panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title" align="center">博客后台登录</h3>
                    </div>
                    <div class="panel-body">
                    
                            <form name="form"  method="post" id="form_value" role="form">
                          
                            <fieldset>
                                <div class="form-group">
                                    <input class="form-control" placeholder="账号" name="username" required="required">
                                </div>
                                <div class="form-group">
                                    <input class="form-control" placeholder="密码" name="password" type="password" required="required">
                                </div>

                                <div class="form-group">
                                    <div class="field">
                                        <input data-validate="required:请输入验证码" class="form-control" name="verify" type="text" placeholder="请输入验证码" required="required">
                                    </div>
                                </div>
                                <div class="form-group" display="none">
		                            <div class="field">
			                            <p align="center">
			                                <img src="?c=User&a=captcha" style="cursor: pointer;" onclick="this.src=this.src" />
			                            </p>
		                            </div>
		                        </div>
		                        <div id="user_login_msg" class="user_login_msg"></div>
                                <!-- Change this to a button or input when using this as a form -->
                                <button class="btn btn-lg btn-success btn-block" type="submit">登陆</button>
                            </fieldset>
                        </form>
                        <script>
                            $(document).ready(function(){
                            	//js用户获得焦点
                           	 	$(document).onload = foucs();
                          	 	function foucs(){
	                           	 	if(document.form.username.value==""){
	                                    document.form.username.focus();
	                                }else{
	                                    document.form.username.select();
	                                }
                          	 	};
	                       	    $("#form_value").submit(function(){
	                       	    	//$.post(document.URL,$("#form_value").serialize(),function(j){
                        	 		//	alert(j.status);
                        	 		//},'json');
	                       	    	$.ajax({
	                       	    		 type:"post",
	                       	    		 dataType:"json",
	                       	    		 url:document.URL,
	                       	    		 data:$("#form_value").serialize(),
	                       	    		 success:function(msg){
	                       	    			 if(!msg.status){
	                       	    				$("#user_login_msg").html(msg.msg);
	                       	    				$("#user_login_msg").fadeIn();
	                       	    			    $("#user_login_msg").fadeIn("slow");
	                       	    			    $("#user_login_msg").fadeIn(8000);
	                       	    			    setTimeout(function(){
	                       	    			    	$("#user_login_msg").fadeOut();
			                       	    		    $("#user_login_msg").fadeOut("slow");
			                       	    		    $("#user_login_msg").fadeOut(2000);
	                       	    			    },1500);
	                       	    			 }else if(msg.status){
	                       	    				$("#user_login_msg").html(msg.msg);
	                       	    				$("#user_login_msg").fadeIn();
	                       	    			    $("#user_login_msg").fadeIn("slow");
	                       	    			    $("#user_login_msg").fadeIn(8000);
	                       	    			    setTimeout(function(){
	                       	    			    	$("#user_login_msg").fadeOut();
			                       	    		    $("#user_login_msg").fadeOut("slow");
			                       	    		    $("#user_login_msg").fadeOut(2000);
	                       	    			    },1500);
	                       	    			    location.href = msg.url;
	                       	    			 }
	                       	    		 }
	                       	    	});
	                       	    	return false;
                       	     	});
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>


</body>

<div class="user-login-footer">
	<p>
		© 2018 <a href="#">常来常往网络科技</a>
	</p>
</div>
</html>
